]> dgit.raspbian.org Git - libreoffice.git/commitdiff
[PATCH] sc: only build the supported data providers when loading a document
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Sun, 12 Jul 2026 18:57:00 +0000 (18:57 +0000)
committerRene Engelhard <rene@debian.org>
Sat, 3 Oct 2026 10:46:08 +0000 (12:46 +0200)
Build a data mapping only for the csv, html and xml providers. Any
other provider name in the document is ignored.

The sql provider is not included. It never worked and was dropped from
the Data Provider dialog in tdf#169079.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iaa8b5ae4f37693d82938c12b725ee05a3b115732
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6708
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9b6d7ec607e68c79ce685f126139ef826776e783)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208149
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 104d2b4f5dae917661b20b18d5d2043fca4407e4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208159
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Gbp-Pq: Name CVE-2026-63268-2.diff

sc/source/filter/xml/xmlmappingi.cxx

index 2048c929d21c04212d68bf4490328ebfc0c55347..809a3cd725600f51279cfdfbd854f8d5e276136d 100644 (file)
@@ -14,6 +14,7 @@
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/xmlnamespace.hxx>
 
+#include <sal/log.hxx>
 #include <datamapper.hxx>
 #include <document.hxx>
 
@@ -102,6 +103,16 @@ ScXMLMappingContext::ScXMLMappingContext( ScXMLImport& rImport,
 
     if (!aProvider.isEmpty())
     {
+        // Only build the data providers we support. The sql provider is left
+        // out: it was never finished and was dropped from the dialog in tdf#169079.
+        if (aProvider != "org.libreoffice.calc.csv"
+            && aProvider != "org.libreoffice.calc.html"
+            && aProvider != "org.libreoffice.calc.xml")
+        {
+            SAL_WARN("sc", "ignoring document data mapping for provider \"" << aProvider << "\"");
+            return;
+        }
+
         ScDocument* pDoc = GetScImport().GetDocument();
         auto& rDataMapper = pDoc->GetExternalDataMapper();
         sc::ExternalDataSource aSource(aURL, aProvider, pDoc);